package org.hhchat.others.jd;

import java.util.Scanner;
import java.util.Stack;

/**
 * Created by hh23485 on 2017/9/8.
 */
public class exam11 {

    public static void main(String[] args) {

        Scanner scanner = new Scanner(System.in);
        String string = scanner.nextLine();
        char[] ch = string.toCharArray();
        Stack s = new Stack<>();
        int count = 0;
        int sum=1;

        for (int i = 0; i < ch.length; i++) {
            if (ch[i] == '(') {
                s.push(ch[i]);
                count++;
            } else {
                s.pop();
                sum*=count;
                count--;
            }
        }



        System.out.print(sum);


    }
}
